
public class DEMO2 {

	public static void main(String[] args) {
		int []num= {1,2,3,4,5,6};
		int a = AS(num);
		System.out.println(a);
	}
	public static int AS(int []a) {
		int result = 0;
		for (int i = 0; i < a.length; i++) {
			if (a[i]>a[0]) {
				result=a[i];
			}else {
				result=a[0];
			}
		}	
		return result;
	}
}
